﻿
@{
    ViewBag.Title = "登录 - ECHO计划笔记";
}

<!DOCTYPE html>
<html lang="en">
<head>
    <title>登录 - ECHO计划笔记</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <!--[if lte IE 8]><script src="~/assets/js/ie/html5shiv.js"></script><![endif]-->
    <link rel="stylesheet" href="~/assets/css/main.css" />
    <!--[if lte IE 9]><link rel="stylesheet" href="~/assets/css/ie9.css" /><![endif]-->
    <!--[if lte IE 8]><link rel="stylesheet" href="~/assets/css/ie8.css" /><![endif]-->
    <style>
        body {
            background: #ffffff;
        }

        .container {
            height: 500px;
            width: 100%;
            position: absolute;
            top: 50%;
            margin-top: -250px;
            background: url("http://pic1.win4000.com/wallpaper/d/53d865c159580.jpg") center center no-repeat;
            padding: 50px 50px 50px 0px;
        }

        #login-content {
            width: 480px;
            padding: 60px;
            position: absolute;
            right: 50px;
            background: rgba(255,255,255,0.8);
            border-radius: 4px;
        }
    </style>
</head>
<body>
    <div class="container">
        <canvas style="width:100%; height:500px; position: absolute; top: 50%;margin-top: -250px; left: 0px; z-index: -1;"></canvas>
        <section id="login-content">
            <h2>Log in</h2>
            @using (Ajax.BeginForm("Login", "Account",new { returnUrl = ViewBag.ReturnUrl }  , new AjaxOptions {
                HttpMethod="POST",
                LoadingElementId="ajax-loader",
                OnSuccess="success",
                OnBegin="validate"
            }))
            {
                <div class="row uniform">
                    <div class="12u$">
                        <input type="text" name="UserName" id="demo-name" value="@ViewBag.UserName" placeholder="用户名" />
                    </div>
                    <div class="12u$">
                        <input type="PassWord" name="PassWord" id="demo-email" value="" placeholder="密码" />
                    </div>

                    <div class="6u 12u$(small)">
                        <input type="checkbox" id="demo-copy" name="demo-copy">
                        <label for="demo-copy">记住我？</label>
                    </div>
                    <div class="12u$">
                        <ul class="actions">
                            <li><input type="submit" id="btnLogin" value="登 录" /></li>
                            <li><input type="reset" value="重 置" /></li>
                        </ul>
                    </div>
                </div>
            }
            <div id="ajax-loader" style="display:none">加载中...</div>
        </section>
    </div>
    <script type="text/javascript" src="~/assets/plugin/canvas-particle.js"></script>
    <script src="~/Scripts/jquery-1.10.2.min.js"></script>
    <script src="~/Scripts/jquery.unobtrusive-ajax.js"></script>
    <script>
		window.onload = function(){
			var config = {
				vx: 4,
				vy:  4,
				height: 2,
				width: 2,
				count: 100,
				color: "121, 162, 185",
				stroke: "100,200,180",
				dist: 6000,
				e_dist: 20000,
				max_conn: 10
			}
			CanvasParticle(config);
		}

		function success(data) {
		    if (data.code == "400") {
		        alert(data.msg);
		    } else {
		        window.location = data.msg;
		    }
		}

		function validate() {
            
		}
    </script>
</body>
</html>